//
//  Skill.m
//  iEVETracker
//
//  Created by Scott Guyer on 7/14/08.
//  Copyright 2008 __MyCompanyName__. All rights reserved.
//

#import "Skill.h"
#import "Character.h"
#import "defs.h"


@implementation Skill

static NSArray* attributeBasicSkills;
static NSArray* attributeAdvancedSkills;

@synthesize typeID    = _typeID;
@synthesize level     = _level;
@synthesize rank      = _rank;
@synthesize points    = _points;
@synthesize name      = _name;
@synthesize groupName = _groupName;
@synthesize primaryAttribute = _primaryAtt;
@synthesize secondaryAttribute = _secondaryAtt;
@synthesize description = _desc;



+ (void) initialize
{
	attributeBasicSkills = [[NSArray alloc] 
							initWithObjects:[NSString stringWithString:@kSkillTypeID_AnalyticalMind], 
							[NSString stringWithString:@kSkillTypeID_InstantRecall],
							[NSString stringWithString:@kSkillTypeID_Empathy], 
							[NSString stringWithString:@kSkillTypeID_SpatialAwareness], 
							[NSString stringWithString:@kSkillTypeID_IronWill],
							nil ];

	attributeAdvancedSkills = [[NSArray alloc] 
							initWithObjects:[NSString stringWithString:@kSkillTypeID_Logic], 
							[NSString stringWithString:@kSkillTypeID_EideticMemory],
							[NSString stringWithString:@kSkillTypeID_Presence], 
							[NSString stringWithString:@kSkillTypeID_Clarity], 
							[NSString stringWithString:@kSkillTypeID_Focus],
							nil ];
}


+ (NSString*) getBasicSkillForAttribute:(PilotAttrType)attType
{
	if ( (attType < kPilotAttrTypeIntel) || (attType >= kPilotAttrTypeCount) )
		return nil;
	return [attributeBasicSkills objectAtIndex:attType];
}

+ (NSString*) getAdvancedSkillForAttribute:(PilotAttrType)attType
{
	if ( (attType < kPilotAttrTypeIntel) || (attType >= kPilotAttrTypeCount) )
		return nil;
	return [attributeAdvancedSkills objectAtIndex:attType];
}


- (id) init
{
	if ( (self = [super init]) != nil )
	{		
		
	}

	return self;
}


- (void) dealloc
{
	NSLog(@"%s 0x%x", __FUNCTION__, self);
	
	WIPE( _name)
	WIPE( _groupName)
	WIPE( _desc)
	
	[super dealloc];
}

@end
